{{template "admin/header.html"}}
<title>查看导航菜单 - GPRESS</title>
{{template "admin/bodystart.html"}}

{{ $categoryName := selectOne "category" "* from category WHERE id=?" .Data.Pid }}

{{ $themeTemplate := themeTemplate }} <!-- 模版数据 -->

<style>
	.code-line .number{
		background-color: transparent;
		font-size: 12px;
		padding: 0;
		vertical-align: unset;
	}
</style>
<section class="section">
	<input type="hidden" id="templateID" value="{{.Data.TemplateID}}">

	<div class="container">
		<div class="table-content">
			<div class="column">
				<form id="gpress-form" action="/" method="POST">
					<ul class="save-ul">
						<li>
							<div class="left">
								ID
							</div>
							<div class="right">
								<input class="input is-small" type="text" disabled value="{{.Data.Id}}" />
							</div>
						</li>
						<li>
							<div class="left">
								导航名称
							</div>
							<div class="right">
								<input class="input is-small" type="text" disabled value="{{.Data.Name}}" />
							</div>
						</li>
						<li>
							<div class="left">
								跳转路径
							</div>
							<div class="right">
								<input class="input is-small" type="text" disabled value="{{.Data.HrefURL}}">
							</div>
						</li>
						<li>
							<div class="left">
								跳转方式
							</div>
							<div class="right">
								<input class="input is-small" type="text" disabled value="{{.Data.HrefTarget}}">
							</div>
						</li>
						<li>
							<div class="left">
								父级导航
							</div>
							<div class="right">
								<input class="input is-small" type="text" value="{{$categoryName.Name}}" disabled>
							</div>
						</li>
						<li>
							<div class="left">
								页面模版
							</div>
							<div class="select is-small">
								<select id="templateSelect" disabled>
									<option value="">默认(category.html)</option>
									{{ range $index,$obj := $themeTemplate }}
									<option value='{{$obj.Id}}'>{{$obj.Name}}</option>
									{{end}}
								</select>
							</div>
						</li>

						<li>
							<div class="left">
								排序
							</div>
							<div class="right">
								<input class="input is-small" type="number" disabled value="{{.Data.SortNo}}">
							</div>
						</li>
						<li>
							<div class="left">
								状态
							</div>
							<div class="right">
							    {{if eq .Data.Status 0 }}
								<input class="input is-small" type="text" disabled value="链接访问">
								{{else if eq .Data.Status 1 }}
								<input class="input is-small" type="text" disabled value="公开">
								{{else if eq .Data.Status 2 }}
								<input class="input is-small" type="text" disabled value="私密">
								{{end}}
							</div>
						</li>
					</ul>

					<div class="field is-grouped" style="padding-left: 190px;">
						<div class="control">
							<a href="{{basePath}}admin/{{.UrlPathParam}}/update?id={{.Data.Id}}"
								class="button is-primary is-small">编辑</a>
						</div>
						<div class="control">
							<a href="{{basePath}}admin/{{.UrlPathParam}}/list" class="button is-info is-light is-small">返回</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</section>
<link href="https://cdn.staticfile.org/wangeditor5/5.1.23/css/style.min.css" rel="stylesheet">
<script>
	let templateID = $('#templateID').val()
	$('#templateSelect').val(templateID)
	
	$('#templateSelect').change(function(e) {
		templateID = $('#templateSelect').val()
	})
</script>

{{template "admin/bodyend.html"}}
